//
//  BK_SPS_Address_Cell.m
//  bestkeep
//
//  Created by TOPTEAM on 2017/4/6.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "BK_SPS_Address_Cell.h"
#import <Masonry.h>
#import "BK_OD_Color.h"
@interface BK_SPS_Address_Cell ()

@property(nonatomic, strong) UIImageView *ImgV_Logo;
@property (nonatomic,strong) UILabel* lab_address1;
@property (nonatomic,strong) UILabel* lab_address2;

@end
@implementation BK_SPS_Address_Cell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self){
        self.backgroundColor = [UIColor whiteColor];
        [self initView];
    }
    return self;
}

- (void)initView{
    
    
    _ImgV_Logo=[[UIImageView alloc]init];
    _ImgV_Logo.backgroundColor = [UIColor whiteColor];
    _ImgV_Logo.contentMode = UIViewContentModeScaleToFill;
    _ImgV_Logo.image=[UIImage imageNamed:@"BK_PayStore_logo"];
    [self addSubview:_ImgV_Logo];
    [_ImgV_Logo mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(self.mas_left).offset(ApplicationBackGauge);
        make.width.mas_equalTo(@(38/2.0));
        make.height.mas_equalTo(@(38/2.0));
    }];
    
    
    
    _lab_address1 = [UILabel new];
    _lab_address1.textColor = kOrderBlack1;
    _lab_address1.numberOfLines = 2;
    _lab_address1.backgroundColor = [UIColor clearColor];
    _lab_address1.font = [UIFont systemFontOfSize:16];
    _lab_address1.text = @"加载中...";
    [self addSubview:_lab_address1];
    [_lab_address1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_ImgV_Logo.mas_right).offset(5.2/2.0);
        make.centerY.equalTo(self.mas_centerY);
    }];
    
    
    _lab_address2 = [UILabel new];
    _lab_address2.textColor = kOrderLightGrey1;
    _lab_address2.numberOfLines = 2;
    _lab_address2.backgroundColor = [UIColor clearColor];
    _lab_address2.font = [UIFont systemFontOfSize:14];
    _lab_address2.text = @"加载中...";
    [self addSubview:_lab_address2];
    [_lab_address2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.left.equalTo(_lab_address1.mas_right).offset(0);
    }];
    
    

    
    
}



-(void)relayOutUIWithModel:(BK_SP_OD_Model *)model{
    _lab_address1.text = @"有糖小店";
//    _lab_address2.text = @"(上海-浦东新区)";
    if (model.store_address) {
        if ([[NSString stringWithFormat:@"%@",model.store_address] length]>0) {
            _lab_address2.text = [NSString stringWithFormat:@"（%@）",model.store_address];
        }else{
            _lab_address2.text = @"";
        }
        
    }else{
        _lab_address2.text = @"";
    }
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+(CGFloat)computeHeight:(id)data{
    return 50;
}
@end
